class Singleton:
    __instance = None
    __has_init = None

    def __new__(cls,*args,**kwargs):
        if cls.__instance is None:
            cls.__instance = super().__new__(cls)
            return cls.__instance

    def __init(self):
        if Singleton.__has_init:
            return

        print('执行初始化')
        Singleton.__has_init = True

s1 = Singleton()